﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reactive.Linq;
using System.Linq.Expressions;
using System.Runtime.Serialization;
using QbservableCore.Serialization;

namespace QbservableCore.Client
{
    /// <summary>
    /// Used as a constant expression within the QbservableBase
    /// </summary>
    [DataContract]
    [KnownType("GetKnownTypes")]
    public class QbservableStub<T> :
        IQbservable<T>, // QbservableStub must implement IQbservable<T> (because of expression concatenation)
        IQbservableStub
    {
        static Type[] GetKnownTypes()
        {
            return new Type[] { typeof(QbservableStub<T>) };
        }

        public QbservableStub(string key)
        {
            Key = key;
        }

        [DataMember]
        public string Key { get; private set; }

        #region IQbservable Members

        Type IQbservable.ElementType
        {
            get { throw new NotImplementedException(); }
        }

        Expression IQbservable.Expression
        {
            get { throw new NotImplementedException(); }
        }

        IQbservableProvider IQbservable.Provider
        {
            get { throw new NotImplementedException(); }
        }

        IDisposable IObservable<T>.Subscribe(IObserver<T> observer)
        {
            throw new NotImplementedException();
        }

        #endregion // IQbservable Members
    }
}
